<template>
    <div id='basic'>
      <div>
        <label>输入文本 自动派发action</label>
        <input type='text' v-model='input1' />
      </div>
      <div>
        <label>输入文本 自动派发action后，执行回调</label>
        <input type='text' v-model='input2' />
      </div>
    </div>
</template>

<script>
export default {
  name: 'Basic',
  data() {
    return {
      input1: '',
      input2: ''
    }
  },
  watch: {
    input1(newVal, oldVal) {
      console.log(newVal)
      this.$store.dispatch('basic/setInput', newVal)
    }

  }
}
</script>

<style scoped lang='scss'></style>
